/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.behavioral.chain;

/**
 *
 * @author jmg
 */
public abstract class Validator {
    
    private Validator next;

    public Validator getNext() {
        return next;
    }

    public void setNext(Validator next) {
        this.next = next;
    }
    
    public void validate(String data){
        execute(data);
        if(next != null){
           next.execute(data);
        }
    }
    
    public abstract void execute(String s);
    
}
